<?php
/**
 * Created by PhpStorm.
 * userValidate: hms
 * Date: 2018/11/26
 * Time: 15:23
 */
namespace app\firm\validate;

use think\Validate;

class projectValidate extends Validate
{

    protected $rule = [
        'project_name' =>  'require',
        'target_code' =>  'require',
//        'platform' =>  'require',
//        'joint_venture' =>  'require',
//        'joint_investment' =>  'require',
//        'release_cycle' =>  'require',
//        'project_detail' =>  'require',
    ];

    protected $message = [
        'project_name.require' => '请输入项目名称',
        'target_code.require' => '请输入目标金额',
//        'platform.require' => '请输入拟定上线平台',
//        'joint_venture.require' => '请输入联合投资',
//        'joint_investment.require' => '请输入联合出品方',
//        'release_cycle.require' => '请输入上映周期',
//        'project_detail.require' => '请输入项目基本情况',
    ];

    public function checkTel($value, $rule, $data = [])
    {
        return preg_match('#^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\\d{8}$#', $value) ? true : '手机号错误';
    }

    public function checkBank($value, $rule, $data = [])
    {
        return preg_match('/^([1-9]{1})(\d{14}|\d{18})$/', $value) ? true : '银行卡号错误';
    }

}